package com.wyzt.item.api;

import com.wyzt.item.pojo.Category;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@RequestMapping("category")
public interface CategoryApi {
    /**
     * 根据父节点id查询商品分类
     *
     * @param pid 父节点id
     * @return
     */
    @GetMapping("list")
    List<Category> queryCategoryListByPid(
            @RequestParam("pid") Long pid);

    /**
     * 根据分类id查询商品分类
     *
     * @param ids
     * @return
     */
    @GetMapping("list/ids")
    List<Category> queryCategoryListByIds(@RequestParam("ids") List<Long> ids);

    /**
     * 根据品牌id查询商品分类
     *
     * @param bid
     * @return
     */
    @GetMapping("bid/{bid}")
    List<Category> queryByBrandId(@PathVariable("bid") Long bid);

    /**
     * 查询三级分类
     *
     * @param id
     * @return
     */
    @GetMapping("level/{id}")
    List<Category> queryParentByCid3(@PathVariable("id") Long id);

}
